# 轮播图信息表
from datetime import datetime

import xadmin
from users.models import BannerInfo
from xadmin import views


# 配置xadmin主题，注册时候需要用到专用的views
class BaseXadminSetting(object):
    enable_themes = True
    use_bootswatch = True


# 配置页头和页尾的信息
class GlobaXadminSetting(object):
    # 页头
    site_title = '波普魔方后台管理系统'
    # 页脚
    site_footer = '波普魔方'
    # 左侧样式 以下拉的形式
    menu_style = 'accordion'


class BannerInfoXadmin(object):
    list_display = ['image', 'url', 'add_time']
    search_fields = ['image', 'url']
    list_filter = ['image', 'url']
    model_icon = 'fa fa-image'


xadmin.site.register(BannerInfo, BannerInfoXadmin)
xadmin.site.register(views.BaseAdminView, BaseXadminSetting)
xadmin.site.register(views.CommAdminView, GlobaXadminSetting)
